//
//  EFShareSettingCell.m
//  WZEfengAndEtong
//
//  Created by wanzhao on 16/3/21.
//  Copyright © 2016年 wanzhao. All rights reserved.
//



#import "EFShareSettingCell.h"
#import "CUserSettingModel.h"

@interface EFShareSettingCell ()



@end

@implementation EFShareSettingCell
+ (EFShareSettingCell *)EFShareSettingCellWithTabelView:(UITableView *)tableView
{
    static NSString *cellId = @"EFShareSettingCell";
    EFShareSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[EFShareSettingCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
        cell.textLabel.textColor = RGBCOLORWITH16COLOR(0x323232);
        cell.textLabel.font = Font18;
        cell.textLabel.numberOfLines = 0;
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    return cell;

}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = WhiteColor;
        self.backgroundColor = ClearColor;
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = RGBCOLOR(212, 212, 212);
        [self.contentView addSubview:view];
        self.lineView = view;
        
        UIView *shortview = [[UIView alloc] init];
        shortview.backgroundColor = RGBCOLOR(212, 212, 212);
        [self.contentView addSubview:shortview];
        self.shortlineView = shortview;

        
        UIButton *accessoryBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [accessoryBtn setImage:[UIImage imageNamed:@"share_select_icon"] forState:UIControlStateNormal];
        accessoryBtn.userInteractionEnabled = NO;
        [self.contentView addSubview:accessoryBtn];
        self.accessoryBtn = accessoryBtn;
        
    }
    return self;
}

- (void)setUserSetting:(CUserSettingModel *)userSetting
{
    _userSetting = userSetting;
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.lineView.frame = CGRectMake(0, self.height - 0.5f, self.width, 0.5f);
    self.shortlineView.frame = CGRectMake(10.0f, self.height - 0.5f, self.width - 10.0f, 0.5f);
    self.accessoryBtn.frame = CGRectMake(self.width - 10.0f - self.accessoryBtn.currentImage.size.width, 0, self.accessoryBtn.currentImage.size.width, self.height);
}

@end
